﻿using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using LTJ.Entity;
using LTJ.Common;
using LTJ.Config;
using LTJ.FrameWork;

namespace LTJ.WebPage.SystemManage.route
{
    /// <summary>
    /// 线路信息批量设置
    /// </summary>
    public partial class routeinfoset : AdminPage
    {
        protected string idslist = SASRequest.GetString("ids");

        /// <summary>
        /// 基本信息修改
        /// </summary>
        protected void editroute_Click(object sender, EventArgs e)
        {
            RouteBaseInfo rbinfo = new RouteBaseInfo();

            rbinfo.loadport = SASRequest.GetString("ajaxloadportdatalist_value");
            rbinfo.tranport = SASRequest.GetString("ajaxtranportdatalist_value");
            rbinfo.destport = SASRequest.GetString("ajaxcorpportdatalist_value");
            rbinfo.routeid = SASRequest.GetInt("ajaxcorproutedatalist_value", 0);
            rbinfo.pier = SASRequest.GetString("ajaxdockdatalist_value");
            rbinfo.range = routerange.Text;
            rbinfo.schbegin = SASRequest.GetString("weekstart_value");
            rbinfo.schend = SASRequest.GetString("weekend_value");
            rbinfo.validbegin = starttime.SelectedDate.ToString();
            rbinfo.validend = endtime.SelectedDate.ToString();
            rbinfo.bio = Utils.RemoveHtml(bio.Text);

            if (rbinfo.routeid > 0 && rbinfo.destport == "")
            {
                base.RegisterStartupScript("PAGETEMPLATE", "请选择目的港！");
                return;
            }
            RouteBases.UpdateBatchRouteInfo(rbinfo, idslist);
            OpLogs.LogRoutesBaseEdit(userid, username, idslist);
            base.RegisterStartupScript("PAGE", "parent.document.getElementById('reclick').click();parent.Lightview.hide();");
        }

        #region Web 窗体设计器生成的代码

        override protected void OnInit(EventArgs e)
        {
            InitializeComponent();
            base.OnInit(e);
        }

        private void InitializeComponent()
        {
            editroute.Click += new EventHandler(editroute_Click);
        }

        #endregion
    }
}